package org.rsbot;

import java.io.IOException;
import java.net.URL;
import java.net.URLDecoder;
import java.security.CodeSource;
import java.security.ProtectionDomain;

public class Boot
{
  public static void main(String[] paramArrayOfString)
    throws IOException
  {
    String str1 = Boot.class.getProtectionDomain().getCodeSource().getLocation().getPath();
    str1 = URLDecoder.decode(str1, "UTF-8").replaceAll("\\\\", "/");
    String str2 = System.getProperty("os.name").toLowerCase();
    String str3 = "-Xmx512m -Dsun.java2d.d3d=false";

    if (str2.contains("windows")) {
      Runtime.getRuntime().exec("javaw " + str3 + " -classpath \"" + str1 + "\" org.rsbot.Application");
    }
    else if (str2.contains("mac")) {
      Runtime.getRuntime().exec(new String[] { "/bin/sh", "-c", "java " + str3 + " -Xdock:name=\"RSBot\"" + " -Xdock:icon=resources/images/icon.png" + " -classpath \"" + str1 + "\" org.rsbot.Application" });
    }
    else
    {
      Runtime.getRuntime().exec(new String[] { "/bin/sh", "-c", "java " + str3 + " -classpath \"" + str1 + "\" org.rsbot.Application" });
    }
  }
}